package com.guigu.guliorder.feign;

import com.guigu.gulicommon.entity.pojo.res.Res;
import com.guigu.gulicommon.entity.vo.SkuInfoPageVo;
import com.guigu.gulicommon.entity.vo.SpuInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 商品远程调用服务
 *
 * @author 陈俊杰
 * @version 1.0
 * @since 2024/9/26 14:13
 */
@FeignClient(value = "gateway-server", path = "/api/product", contextId = "ProductServer")
public interface ProductServer {
    /**
     * 根据Id列表获取商品信息
     *
     * @param ids 商品id列表
     * @return 商品信息列表
     */
    @GetMapping("/sku-info/list")
    Res<SkuInfoPageVo> getListByIds(@RequestParam("ids") List<Long> ids);


    /**
     * 根据skuId得到spu信息
     *
     * @param skuIds skuId集合
     * @return spu信息
     */
    @PostMapping("/spu-info/skuId")
    Res<SpuInfoVo> getSpuInfoBySkuId(@RequestParam(value = "skuId") List<Long> skuIds);
}
